package com.cn.auth.serviceImpl.sys;

import java.util.List;
import javax.annotation.Resource;
import com.cn.auth.po.sys.AuthLog;
import com.cn.auth.po.sys.AuthUser;
import org.springframework.stereotype.Service;
import com.cn.auth.dao.sys.UserDao;
import com.cn.auth.service.sys.UserService;
/**
 * Service实现类
 * @author Maochao-zhu
 *
 */
@Service
public class UserServiceImpl implements UserService {
	@Resource
	UserDao userDao;


	@Override
	public Integer insertUser(AuthUser user) {
		return userDao.insertUser(user);
	}

	@Override
	public Integer deleteUserById(String[] ids) {
		return userDao.deleteUserById(ids);
	}

	@Override
	public Integer updateUserById(AuthUser user) {
		return userDao.updateUserById(user);
	}

	@Override
	public AuthUser getUserById(Integer id) {
		return userDao.getUserById(id);
	}
	public AuthUser getUserByLogin(String uname) {
		return userDao.getUserByLogin(uname);
	}

	@Override
	public List<AuthUser> getUserList(AuthUser user) {
		return userDao.getUserList(user);
	}

	@Override
	public Integer getUserListCount(AuthUser user) {
		return userDao.getUserListCount(user);
	}

	@Override
	public Integer getUserByLoginName(String uname, Integer id) {
		return userDao.getUserByLoginName(uname, id);
	}

	@Override
	public List<AuthUser> checkUserLogin(String username, String password) {
		return userDao.checkUserLogin(username, password);
	}

	@Override
	public List<AuthLog> getLogList(AuthLog log) {
		return userDao.getLogList(log);
	}

	@Override
	public Integer getLogListCount(AuthLog log) {
		return userDao.getLogListCount(log);
	}

	@Override
	public Integer deleteLog(String[] ids) {
		return userDao.deleteLog(ids);
	}

	@Override
	public Integer insertLog(AuthLog log) {
		return userDao.insertLog(log);
	}

	@Override
	public Integer insertLog(String context){
		AuthLog log = new AuthLog();
		log.setUname("系统监控");
		log.setTname("系统监控");
		log.setContent(context);
		return userDao.insertLog(log);
	}

	@Override
	public List<AuthUser> getUserByBranchId(Integer branchId) {
		return userDao.getUserByBranchId(branchId);
	}

	@Override
	public Integer getUserNextMaxOrderBy() {
		return userDao.getUserNextMaxOrderBy();
	}
}
